<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增团员')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: jasny-bootstrap-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-teamYl-add">
            <input type="hidden" name="ylId" id="ylId" readonly>
            <input type="hidden" name="ylName" id="ylName" readonly>
            <h4 class="form-header h4" >团队编号信息</h4>
            <div class="row">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">团队编号：</label>
                    <div class="col-sm-8">
                        <input name="teamYlId"  id="teamYlId" class="form-control"   type="text" required readonly>
                    </div>
                </div>
            </div>
            <h4 class="form-header h4" >团长信息</h4>
            <div class="row">
                <div class="form-group">
                    <label class="col-sm-3 control-label  is-required">团长代理编号：</label>
                    <div class="col-sm-8">
                        <input name="agentNum" onclick="selectTeamGroupView()" readonly id="agentNum" type="text" class="form-control" required>
                        <i class="fa fa-search" style="margin-top: -22px;margin-right:3px;float:right;"></i>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">团长代理名称：</label>
                    <div class="col-sm-8">
                        <input name="agentName" class="form-control" id="agentName" type="text" required readonly>
                    </div>
                </div>
            </div>
            <h4 class="form-header h4" >团员信息</h4>
            <div class="row">
                <div class="form-group">
                    <label class="col-sm-3 control-label  is-required">团员代理编号：</label>
                    <div class="col-sm-8">
                        <input name="leaderAgentNum" onclick="selectAllAgent()" readonly id="teamAgentNum" type="text" class="form-control" required>
                        <i class="fa fa-search" style="margin-top: -22px;margin-right:3px;float:right;"></i>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">团员代理名称：</label>
                    <div class="col-sm-8">
                        <input name="leaderAgentName" class="form-control" id="teamAgentName" type="text" required readonly>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">采购机器数量：</label>
                    <div class="col-sm-8">
                        <input name="posNum" class="form-control" placeholder="资深总监累计采购1000"  type="number" required >
                    </div>
                </div>
            </div>
        </form>
    </div>
            <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: jasny-bootstrap-js" />
    <script th:inline="javascript">
        var prefix = ctx + "team/teamYlInfo"
        $("#form-agentPosOperation-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/addGroup", $('#form-teamYl-add').serialize());
            }
        }



        /**
         * 选择团长
         */
        function selectTeamGroupView() {
            var url =prefix+ "/selectTeamGroupView";
            $.modal.open("选择团长" , url, '1100',"500");
        }


        /**
         * 选择团员
         */
        function selectAllAgent() {
            var agentNum = $("#agentNum").val();
            if ($.common.isEmpty(agentNum)){
                $.modal.alertWarning("请选择团长");
                return;
            }
            var url =prefix+ "/selectAllAgent";
            $.modal.open("选择团员" , url, '1100',"500");
        }

    </script>
</body>
</html>